package com.woniuxy.springparking.controller;

import com.woniuxy.springparking.asepct.SysLog;
import com.woniuxy.springparking.common.RestDto;
import com.woniuxy.springparking.common.RestResult;
import com.woniuxy.springparking.pojo.PreOrder;
import com.woniuxy.springparking.service.OrderService;
import com.woniuxy.springparking.vo.MerchentUserVo;
import com.woniuxy.springparking.vo.OverOrderVo;
import com.woniuxy.springparking.vo.PerOrderVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/perOrderSelectByPage.do")
    @ApiOperation(value = "分页查询所有预约订单信息",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = RestResult.class,notes = "分页查询所有预约订单信息")
    public RestResult perOrderSelectByPage(PerOrderVo pvo){
        return orderService.findPerOderByPage(pvo);
    }

    @GetMapping("/overOrderSelectByPage.do")
    @ApiOperation(value = "分页查询所有超时订单信息",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = RestResult.class,notes = "分页查询所有超时订单信息")
    public RestResult overOrderSelectByPage(OverOrderVo ovo){
        return orderService.findOverOderByPage(ovo);
    }

    @GetMapping("/findPlatenum.do")
    @ApiOperation(value = "按用户id查询车牌号",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = String.class,notes = "按用户id查询车牌号")
    public String findPlatenum(Integer pu_id){
        return orderService.findPlatenum(pu_id);
    }

    @GetMapping("/findMuPrice.do")
    @ApiOperation(value = "按商户id查询商家车位单价",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = Double.class,notes = "按商户id查询商家车位单价")
    public Double findMuPrice(Integer mu_id){
        return orderService.findMuPrice(mu_id);
    }

    @GetMapping("/findStallPrice.do")
    @ApiOperation(value = "按个体户id查询个体户车位单价",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = Double.class,notes = "按个体户id查询个体户车位单价")
    public Double findStallPrice(Integer pu_id){
        return orderService.findPuPrice(pu_id);
    }

    @GetMapping("/findPerNum.do")
    @ApiOperation(value = "查询超时订单单号",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = String.class,notes = "查询超时订单单号")
    public String findPerNum(Integer orderId){
        return orderService.findPrNum(orderId);
    }
}
